package com.qf.boot2202day02.config;

import com.qf.boot2202day02.filter.HelloFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class FilterConfig  {

    @Bean
    public FilterRegistrationBean<HelloFilter> filterFilterRegistrationBean(){


        final FilterRegistrationBean<HelloFilter> helloFilterFilterRegistrationBean = new FilterRegistrationBean<>();

        helloFilterFilterRegistrationBean.addUrlPatterns("/hello");

//        helloFilterFilterRegistrationBean.setOrder(1);

        helloFilterFilterRegistrationBean.setFilter(new HelloFilter());

        return helloFilterFilterRegistrationBean;

    }

}
